
import homeZflshIcon from '@/assets/img/main/zflsh.png';
import homeXjjxsIcon from '@/assets/img/main/xjjxs.png';
import homeLshglIcon from '@/assets/img/main/lshgl.png';
import homeJybfzIcon from '@/assets/img/main/jybfz.png';
import homeWtdxIcon from '@/assets/img/main/wtdx.png';
import homeWtscIcon from '@/assets/img/main/wtsc.png';
import homeFzjgIcon from '@/assets/img/main/fzjg.png';
import { routerPath } from '@/router/routerPath.js';
import uiUtil from "@/util/UiUtil.js";

// 定义枚举对象
export const BeiAnTypeEnum = {
  FZJG: { type: "1", icon: homeFzjgIcon, text: '分支机构', gldes: "您可以查看备案指南帮助您了解", bg: 'rgb(226, 248, 244)', glsort: 4, select: true, glpath: routerPath.ShouliBeianList, xqpath: routerPath.FZJGXiangQingPage },
  WTDX: { type: "2", icon: homeWtdxIcon, text: '委托代销', gldes: "您可以查看备案指南帮助您了解", bg: 'rgb(224, 246, 255)', glsort: 3, select: true, glpath: routerPath.ShouliBeianList, xqpath: routerPath.JYBFZXiangQingPage },
  WTSC: { type: "3", icon: homeWtscIcon, text: '委托生产', gldes: "您可以查看备案指南帮助您了解", bg: 'rgb(254, 244, 232)', glsort: 1, select: true, glpath: routerPath.ShouliBeianList, xqpath: routerPath.WTSCXiangQingPage },
  JYBFZ: { type: "4", icon: homeJybfzIcon, text: '经营不分装', gldes: "您可以查看备案指南帮助您了解", bg: 'rgb(254, 241, 238)', glsort: 2, select: true, glpath: routerPath.ShouliBeianList, xqpath: routerPath.JYBFZXiangQingPage },
};

// 获取类型的详细信息
export const getBeiAnType = (type) => {
  const typeDetails = Object.values(BeiAnTypeEnum).find(item => item.type == type.toString());
  return typeDetails;
};

export const getGlBaList = () => {
  return Object.values(BeiAnTypeEnum).sort((a, b) => a.glsort - b.glsort);
}

export const setGlCount = (data) => {
  BeiAnTypeEnum.FZJG.glcount = data.BrancheAcceptCount
  BeiAnTypeEnum.JYBFZ.glcount = data.ForeverOperatorAcceptCount
  BeiAnTypeEnum.WTDX.glcount = data.OperatorAcceptCount
  BeiAnTypeEnum.WTSC.glcount = data.ProductionAcceptCount
}